package com.rem.designPattern.factory工厂方法.factoryMethoad;

/**
 * 需求：设计一个咖啡店点餐系统。
 * 根据不同咖啡工厂创建不同的咖啡
 *
 * @author Rem
 * @date 2022-11-14
 */
public class CoffeeStore {
    private CoffeeFactory factory;

    public void setFactory(CoffeeFactory factory) {
        this.factory = factory;
    }

    public Coffee orderCoffee() {
        Coffee coffee = factory.createCoffee();
        //加配料
        coffee.addMilk();
        coffee.addsugar();
        return coffee;
    }
}